1. Statement of the Technical Field
The present invention relates to the deployment of a server page in a multi-tier distributed application environment and more particularly to the modification of a server page to reduce the cost of incorporating custom tags in the server page.
2. Description of the Related Art
Traditional client server application mix presentation and business logic in the client tier while the server tier provides backend data storage and server side business logic. Consequently, client server applications typically cannot scale within the enterprise given the difficulty in maintaining both the client tier and the server tier. Specifically, changes to the presentation layer of an application require the modification of the client side application which can impact the integrity of the business logic within the client tier. Similarly, changes to the business logic of the client can jeopardize the integrity of the presentation code in the client tier. Developing for the client tier also can be problematic where logic developers further develop the presentation layer, or where human factors designers develop for the logic layer of the application in the client tier.
To force a separation of the presentation and logic layers as is preferred among contemporary computer scientists, server page technologies have become the preferred vehicle for multi-tier application. Server page technologies release the client tier from the responsibility of processing logic for rendering the presentation layer. Moreover, server pages largely separate presentation layer logic from the static elements of the presentation layer so that user interface designers can perform changes to the static elements of the presentation layer without breaching the integrity of the programmatic elements of the presentation layer.
Typical server page technologies permit a mixing of statically defined user interface elements and programmatic scripts in a single document. The programmatic scripts can be processed server-side to produce a translated presentation layer document. The translated presentation layer document can be delivered to the client side where the translated presentation layer document can be rendered to a user interface. Notably, in addition to embedded programmatic scripts, the server page further can include macro references to externally defined programmatic logic. In this way, the complexity of the programmatic logic can be hidden from the view of the user interface designer charged with the development and maintenance of the server page.
Java Server Page™ (JSP) and the active server page (ASP) represent two popular server page technologies which have been deployed widely in recent years. JSPs, in particular, are a well-known and accepted method of displaying content in a Web application. JSPs combine the ease of use of a markup language document for the Web developer with power and flexibility of a scripting language for the applications developer. Consequently, at present JSPs are the preferred way to display information produced by the business logic of an application deployed within an application server, such as the WebSphere® application server manufactured by the International Business Machines Corporation of Armonk, N.Y., United States of America.
Notably, the ease of use of the JSP stems from the fact that a JSP typically consists mostly of markup, which can be created and managed by a Web developer using familiar development tools. The power of the JSP, on the other hand, stems from the fact that a JSP can contain arbitrary Java code. Advantageously, the jointly formed document can be compiled and the resulting compilation can be executed by a JSP aware Web application server such as the WebSphere™ application server manufactured by IBM Corporation of Armonk, N.Y.
Server pages which include significant amounts of both markup and code can become quite difficult to maintain. In this regard, server pages can be difficult to read and maintaining a server page can require the skills of both a programmer and a page designer. To remedy the difficulty of maintaining server pages, custom tag libraries have been developed to offload substantially complex logic from the server page. In particular, much like a macro, custom tags can encapsulate logic within a server page without directly requiring the embedding of code in the server page. At compile time, the custom tags can be processed by the server page compiler.
In operation, for each use of a custom tag, the server page compiler can create an instance of a class which implements the custom tag. Once instantiated, several attributes can be set in relation to the instance. Finally, lifecycle methods included in the compiled rendition of the server page can be called in relation to the instance. While the lifecycle methods included in the instantiation can vary by server page reference implementation, in the JSP specification, lifecycle methods always are incorporated in the compiled object produced by the JSP compiler.
It has been recognized by many skilled artisans that custom tags represent a great advance in maintainability for server pages which need to contain both logic as well as markup. Nevertheless, server pages impose a runtime performance cost which may not justify the use of server page technology. Specifically, oftentimes a single custom tag can perform a very small bit of logic, such as fetching a message from a resource bundle or computing a resource address to place in the resulting page. In this case, the processing overhead for the custom tag lifecycle sometimes can be greater than the processing time required for the logic reference by the tag.